#include <Arduino.h>

// put function declarations here:
int latch_pin = 3; // SHCP脚
int clock_pin = 4; // STCP脚
int data_pin = 2;  // DS脚

void setup()
{
  // put your setup code here, to run once:
  pinMode(latch_pin, OUTPUT);
  pinMode(clock_pin, OUTPUT);
  pinMode(data_pin, OUTPUT);
}

void loop()
{
  // put your main code here, to run repeatedly:
  for (int i = 0; i <= 255; i++)
  {
    digitalWrite(latch_pin, LOW);
    shiftOut(data_pin, clock_pin, LSBFIRST, i);
    digitalWrite(latch_pin, HIGH);
    delay(300);
  }
}

// put function definitions here: